package com.blackcat.springbootcloud.controller;

import com.blackcat.springbootcloud.feign.ConsumerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RefreshScope
@RequestMapping("/consumer")
public class ConsumerController {

    @Autowired
    ConsumerService consumerService;

    @RequestMapping("/test")
    @ResponseBody
    public String test() throws InterruptedException {
        Thread.sleep(5000);
        return consumerService.test();
    }
}
